import { strToNum } from '@src/assets/js/tool'
import moment from 'moment'
export function getColumn () {
  return [
    {
      title: '序号',
      dataIndex: 'orderno',
      key: 'orderno',
      align: 'center',
      width: 60
    },
    {
      title: '交费单类型',
      dataIndex: 'type',
      key: 'type'
    },
    {
      title: '争议金额',
      dataIndex: 'dispute_amount',
      key: 'dispute_amount',
      render: (v, l) => {
        v = strToNum(v) + strToNum(l.dispute_amount_amend)
        if (v) {
          return v.toFixed(2)
        }
      }
    },
    {
      title: '行为',
      dataIndex: 'item_count',
      key: 'item_count',
      render: (v, l) => {
        v = strToNum(v) + strToNum(l.item_count_amend)
        return v
      }
    },
    {
      title: '受理费',
      dataIndex: 'fee_acceptance',
      key: 'fee_acceptance',
      render: (v, l) => {
        v = strToNum(v) + strToNum(l.fee_acceptance_amend)
        return v.toFixed(2)
      }
    },
    {
      title: '处理费',
      dataIndex: 'fee_processing',
      key: 'fee_processing',
      render: (v, l) => {
        const r = strToNum(v) + strToNum(l.fee_processing_amend)
        return r.toFixed(2)
      }
    },
    {
      title: '交费金额',
      dataIndex: 'pay_amount',
      key: 'pay_amount',
      render: (v) => {
        v = strToNum(v)
        if (v) {
          return v.toFixed(2)
        }
        return v
      }
    },
    {
      title: '交费时间',
      dataIndex: 'pay_datetime',
      key: 'pay_datetime',
      render: (v) => {
        v = strToNum(v)
        if (v) {
          return moment(v * 1000).format('YYYY-MM-DD')
        }
      }
    }
  ]
}
